<template>
  <div class="box">
    <div class="jf">
      <el-button type="warning" style="width: 110px; height:40px;  margin-right: 35px;" @click="submitForm('ruleForm')"> <i class="el-icon-coin" style="margin-right:10px;"></i>缴费</el-button>
    </div>

    <div class="guahaobox">
        <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm" label-position="top">
          <el-form-item label="挂号单号" prop="danhao">
            <el-input v-model="ruleForm.danhao"></el-input>
          </el-form-item>
          <el-form-item label="科室" prop="keshi">
            <el-select v-model="ruleForm.keshi" placeholder="">
              <el-option label="请选择" value=""></el-option>
              <el-option label="科室一" value="1"></el-option>
              <el-option label="科室二" value="2"></el-option>
              <el-option label="科室三" value="3"></el-option>
              <el-option label="科室四" value="4"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="接诊类型" prop="type">
            <el-select v-model="ruleForm.type" placeholder="">
              <el-option label="请选择" value=""></el-option>
              <el-option label="类型一" value="1"></el-option>
              <el-option label="类型二" value="2"></el-option>
              <el-option label="类型三" value="3"></el-option>
              <el-option label="类型四" value="4"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="接诊医生" prop="doctor">
            <el-select v-model="ruleForm.doctor" placeholder="">
              <el-option label="请选择" value=""></el-option>
              <el-option label="医生一" value="1"></el-option>
              <el-option label="医生二" value="2"></el-option>
              <el-option label="医生三" value="3"></el-option>
              <el-option label="医生四" value="4"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="挂号费用" prop="price">
            <el-select v-model="ruleForm.price" placeholder="">
              <el-option label="请选择" value=""></el-option>
              <el-option label="5" value="1"></el-option>
              <el-option label="10" value="2"></el-option>
              <el-option label="20" value="3"></el-option>
              <el-option label="30" value="4"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="诊疗费" prop="price2">
            <el-select v-model="ruleForm.price2" placeholder="">
              <el-option label="请选择" value=""></el-option>
              <el-option label="100" value="1"></el-option>
              <el-option label="200" value="2"></el-option>
              <el-option label="300" value="3"></el-option>
              <el-option label="400" value="4"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="挂号日期">
            <el-col :span="11">
              <el-form-item prop="date">
                <el-date-picker type="date" placeholder="选择日期" v-model="ruleForm.date" style="width: 100%;"></el-date-picker>
              </el-form-item>
            </el-col>
          </el-form-item>
          <el-form-item label="挂号员" prop="person">
            <el-input v-model="ruleForm.person"></el-input>
          </el-form-item>


        </el-form>

    </div>
  </div>

</template>

<script>
export default {
      data() {
        return {
          ruleForm: {
            danhao: '',
            keshi:'',
            type:'',
            doctor:'',
            price:'',
            price2:'',
            data:'',
            person:'',
          },
          rules: {
            danhao: [
              { required: false, message: '请输入挂号单号', trigger: 'blur' },
              // { type:'number', message:'请输入数值',trigge:'blur' }
              // { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
            ],
            keshi: [
            { required: true, message: '请选择科室', trigger: 'change' }
            ],
            type: [
            { required: true, message: '请选择接诊类型', trigger: 'change' }
            ],
            doctor: [
            { required: true, message: '请选择接诊医生', trigger: 'change' }
            ],
            price: [
            { required: true, message: '请选择挂号费用', trigger: 'change' }
            ],
            price2: [
            { required: false, message: '请选择诊疗费', trigger: 'change' }
            ],
            date: [
            { type: 'date', required: false, message: '请选择日期', trigger: 'change' }
            ],
            person: [
            { required: false, message: '请选择诊疗费', trigger: 'change' }
            ],
          }
        }
      },
      methods: {
        submitForm(formName) {
          this.$refs[formName].validate((valid) => {
            if (valid) {
              alert('挂号成功!');
            } else {
              console.log('error submit!!');
              return false;
            }
          });
        },
      }

}
</script>

<style lang="less" scoped>

  .box{
    height: 35%;
  }


  .jf {
    height: 70px;
    display: flex;
    justify-content: right;
    align-items: center;
  }
  
  .guahaobox{
    width: 96%;
    height: 90%;
    border-radius: 8px;
    margin-left: 2%;
    background-color: rgb(230,231,251);
    // margin-top: 2%;
  }

  .el-form-item{
    width:20%;
    margin: 3px 2%;
  }
  .guahaobox .el-form{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin-left:-30px ;
  }


</style>